<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>优惠券列表</title>
<script type="text/javascript" src="../boot.js"></script>
<script>
var tbgrid=null;
function parsePage(){
tbgrid=$('#tbList').datagrid({
				data:{"total":120,"rows":[{'id':'1','col2':'99872206','col3':'KingCamp/康尔健野 户外露营 单人双层 木乃伊/玛咪式 轻便舒适蓝色睡袋KS3120蓝色','col4':'康尔健野','col5':'￥159','col6':8}]},
				singleSelect:false,
		    columns:[[
					{
					title:'请选择',
					field:'col1',
					width:80,
					formatter:function(){
						return '<input type="radio" name="optsel" />';
					}
				  },
					{
					title:'赠品编码',
					field:'col2',
					width:150
					},{
					title:'赠品名称',
					field:'col3',
					width:80
					},{
					title:'所属品牌',
					field:'col4',
					width:80
					},{
					title:'销售价',
					field:'col5',
					width:80
					},{
					title:'库存',
					field:'col6',
					width:120
					},{
					title:'发放结束时间',
					field:'col7',
					width:120
					}
		]]

	});
	

}

function save(dialog){
	var rows=tbgrid.datagrid('getSelections');
	$.each(rows,function(i,v){
		if(!$('#coupon_'+v.id,parent.$('#couponList'))[0]){
			var str='<li id="coupon_'+v.id+'"><input type="text" readonly value="'+v.col2+'" name="giftCouponName"  class="ipt" /> <select class="easyui-combobox" data-options="width:40" name="giftCouponCount"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option></select> <a class="easyui-linkbutton jsDelCoupon" data-options="plain:true,iconCls:\'icon-del\'"></a></li>';
			parent.$('#couponList ul').append(str);
		}
	});
	$.parser.parse(parent.$('#couponList'));
	dialog.close();
}
</script>
</head>

<body class="easyui-layout">
<div data-options="region:'north',border:false" >
    <div class="search-div">
        <form name="searchForm" id="searchForm" action="" method="post" >
            <table class="search-tb" >
                <col width="80" />
                <col/>
                <col width="80" />
                <col/>
                <col width="80" />
                <col/>
                <col width="80" />
                <col/>
                <tbody>
                    <tr>
                        <th>优惠券方案：</th>
                        <td><input type="text" class="ipt" /></td>
                        <th>类别：</th>
                        <td><select id="type" name="type" class="easyui-combobox">
                                <option value="1">优惠券</option>
                                <option value="5">礼品卡</option>
                            </select></td>
                    </tr>
                </tbody>
            </table>
        </form>
    </div>
</div>
<!--搜索end--> 
<!--列表-->
<div data-options="region:'center',border:false">
    <table id="tbList">
    </table>
</div>
</body>
</html>
